Update Disk Cache template replacement to replace all instances of variable key #330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current template implementation in cache_disk.c only replaces the first instance of a templated variable while there may exist more instances of it within the setting. For example, something like:
<template>/tmp/template-test/{tileset}/{grid}/{dim}/{z}/{x}/{z}_{y}.{ext}</template>
would get renamed to:
<template>/tmp/template-test/myTileset/myGrid/someDim/4/1/{z}_0.png</template>
rather than what one might expect:
<template>/tmp/template-test/myTileset/myGrid/someDim/4/1/4_0.png</template>
Is there currently a reason why only the first instance of a key is replaced even though the implementation to replace all keys in a given string already exists within source?
I couldn't find any documentation or references in the example mapcache.xml file that would suggest that only one instance of the key is allowed/